<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>下拉菜单2</title>
		<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
		<script src="js/jquery-2.1.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div class="dropdown" id="mydropdown">
			<button id="dlabel" type="button" class="btn btn-default"
				data-toggle="dropdown">
				下拉菜单
				<span class="caret"></span>
			</button>
			<ul class="dropdown-menu" role="menu">
				<li><a href="#">hello</a></li>
				<li><a href="#">hello</a></li>
				<li><a href="#">hello</a></li>
				<li><a href="#">hello</a></li>
			</ul>
		</div>
		<script>                /*即将显示前执行*/
			$("#mydropdown").on("show.bs.dropdown",function(e){
				alert("hello");
			})
		</script>
	</body>
</html>
